package com.jiyun.advice;

import com.jiyun.pojo.JsonRes;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author: 刘清芳
 * @description: 解决controller层抛出的异常
 * @date: 2023/12/19 19:15
 */
@RestControllerAdvice
public class GobalException {
    @ExceptionHandler
    public JsonRes handlerException(Exception e){
        e.printStackTrace();
        return JsonRes.error("网络加载错误");
    }
}
